# -*- coding: utf-8 -*-

class Diagram:
    def __init__(self):
        '''self.selection = []
        self.new_element = None
        self.region = False'''
        self.__elements = []
        
    def add_element(self, element):
        self.__elements.append(element)
    
    def remove_element(self, element):
        self.__elements.remove(element)
    
    def get_elements_by_type(self, type):
        return [e for e in self.__elements if e.__module__.find(type) != -1]
    
    def check_element_type(self, element, type):
        return element.__module__.find(type) != -1
